package org.ccams.dao;

import java.util.List;
import org.ccams.domain.TInhead;
import org.ccams.util.PageParameter;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

public class TInheadDAO extends SqlMapClientDaoSupport{

    
    public TInheadDAO() {
        super();
    }

    /**
	 * 返回指定页码的数据
	 * @return
	 */
	@SuppressWarnings({ "unchecked", "deprecation" })
	public  List<TInhead> getByPage(PageParameter pageParmeter){		
		return getSqlMapClientTemplate().queryForList("t_inhead.getByPage", pageParmeter);
	}
	/**
	 * 返回记录总数
	 * @return
	 */
	public int getCount(PageParameter page){
		return (Integer)getSqlMapClientTemplate().queryForObject("t_inhead.getCount",page);
	}
    
    public void insert(TInhead record) {
        getSqlMapClientTemplate().insert("t_inhead.abatorgenerated_insert", record);
    }

    
    public int updateByPrimaryKey(TInhead record) {
        int rows = getSqlMapClientTemplate().update("t_inhead.abatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    
    public int updateByPrimaryKeySelective(TInhead record) {
        int rows = getSqlMapClientTemplate().update("t_inhead.abatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

   
    public TInhead selectByPrimaryKey(Long id) {
        TInhead key = new TInhead();
        key.setId(id);
        TInhead record = (TInhead) getSqlMapClientTemplate().queryForObject("t_inhead.abatorgenerated_selectByPrimaryKey", key);
        return record;
    }

   
    public int deleteByPrimaryKey(Long id) {
        TInhead key = new TInhead();
        key.setId(id);
        int rows = getSqlMapClientTemplate().delete("t_inhead.abatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }
}